<html>
   <head>
      <link rel="stylesheet" type="text/css" href="style.css" />
   </head>
   <body onload="">
<h2 class="comptitle">Simple Module <i>WiseRoute</i></h2>
<b>Package:</b> org.mixim.modules.netw<br/><b>File: <a href="modules-netw-WiseRoute.ned.html">modules/netw/WiseRoute.ned</a></b><br/><p><a href="../doxy/a00028.html" target="mainframe"><b>C++ definition</b></a></p>

<p>Wiseroute is a simple loop-free routing algorithm that
builds a routing tree from a central network point, designed
for sensor networks and convergecast traffic.</p>
<p>The sink (the device at the center of the network) broadcasts
a route building message. Each network node that receives it
selects the sink as parent in the routing tree, and rebroadcasts
the route building message. This procedure maximizes the probability
that all network nodes can join the network, and avoids loops.
Parameter sinkAddress gives the sink network address, 
rssiThreshold is a threshold to avoid using bad links (with too low
RSSI values) for routing, and routeFloodsInterval should be set to
zero for all nodes except the sink. Each routeFloodsInterval, the
sink restarts the tree building procedure. Set it to a large value
if you do not want the tree to be rebuilt.</p>
<img src="org.mixim.modules.netw.WiseRoute-type.png" ismap="yes" usemap="#type-diagram"/><map name="type-diagram">
<area shape="rect" href="org.mixim.modules.netw.WiseRoute.html" title="WiseRoute" alt="WiseRoute" coords="0,0,113,40">
</map>
<h3 class="subtitle">Usage diagram:</h3>
<p>The following diagram shows usage relationships between types.
Unresolved types are missing from the diagram. Click <a href="full-ned-usage-diagram.html">here</a> to see the full picture.</p>
<img src="org.mixim.modules.netw.WiseRoute-usage.png" ismap="yes" usemap="#usage-diagram"/><map name="usage-diagram"><area shape="rect" id="node1" href="org.mixim.modules.netw.WiseRoute.html" title="Simple Module WiseRoute" alt="" coords="5,6,91,34">
</map>
<h3 class="subtitle">Inheritance diagram:</h3>
<p>The following diagram shows inheritance relationships for this type.
Unresolved types are missing from the diagram. Click <a href="full-ned-inheritance-diagram.html">here</a> to see the full picture.</p>
<img src="org.mixim.modules.netw.WiseRoute-inheritance.png" ismap="yes" usemap="#inheritance-diagram"/><map name="inheritance-diagram"><area shape="rect" id="node1" href="org.mixim.modules.netw.WiseRoute.html" title="Simple Module WiseRoute" alt="" coords="20,83,105,111">
<area shape="rect" id="node2" href="org.mixim.base.modules.BaseNetwLayer.html" title="Simple Module BaseNetwLayer" alt="" coords="5,6,120,34">
</map>
<h3 class="subtitle">Extends:</h3>
<table>
<tr>
   <td>
      <a href="org.mixim.base.modules.BaseNetwLayer.html">BaseNetwLayer</a>
      <i> (simple&nbsp;module)</i>
   </td>
   <td>

<p>Base module for every network layer module</p>
   </td>
</tr>
</table>
<h3 class="subtitle">Parameters:</h3>
<table class="paramtable">
   <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Default value</th>
      <th>Description</th>
   </tr>
<tr class="inherited">
   <td width="150">notAffectedByHostState</td>
   <td width="100">
      <i>bool</i>
   </td>
   <td width="120">false</td>
   <td>
   </td>
</tr>
<tr class="inherited">
   <td width="150">coreDebug</td>
   <td width="100">
      <i>bool</i>
   </td>
   <td width="120"></td>
   <td>
<p>debug switch for core framework</p>
   </td>
</tr>
<tr class="inherited">
   <td width="150">stats</td>
   <td width="100">
      <i>bool</i>
   </td>
   <td width="120"></td>
   <td>
<p>stats switch</p>
   </td>
</tr>
<tr class="inherited">
   <td width="150">headerLength</td>
   <td width="100">
      <i>double</i>
   </td>
   <td width="120"></td>
   <td>
<p>length of the network packet header (in bits)</p>
   </td>
</tr>
<tr class="local">
   <td width="150">debug</td>
   <td width="100">
      <i>bool</i>
   </td>
   <td width="120">false</td>
   <td>
<p>debug switch</p>
   </td>
</tr>
<tr class="local">
   <td width="150">trace</td>
   <td width="100">
      <i>bool</i>
   </td>
   <td width="120">false</td>
   <td>   </td>
</tr>
<tr class="local">
   <td width="150">useSimTracer</td>
   <td width="100">
      <i>bool</i>
   </td>
   <td width="120">false</td>
   <td>
   </td>
</tr>
<tr class="local">
   <td width="150">sinkAddress</td>
   <td width="100">
      <i>int</i>
   </td>
   <td width="120">0</td>
   <td>
<p>sink node address (integer)</p>
   </td>
</tr>
<tr class="local">
   <td width="150">rssiThreshold</td>
   <td width="100">
      <i>double</i>
   </td>
   <td width="120">-50 dBm</td>
   <td>
<p>RSSI threshold for route selection</p>
   </td>
</tr>
<tr class="local">
   <td width="150">routeFloodsInterval</td>
   <td width="100">
      <i>double</i>
   </td>
   <td width="120">0 s</td>
   <td>
<p>If set to zero, this node does not initiates route tree building.
If set to a value larger than zero, this nodes periodically initiates route tree building.</p>
   </td>
</tr>
</table>
<h3 class="subtitle">Properties:</h3>
<table class="paramtable">
   <tr>
      <th>Name</th>
      <th>Value</th>
      <th>Description</th>
   </tr>
<tr>
   <td width="150">class</td>
   <td width="100"><i>WiseRoute</i></td>
   <td>
</td>
</tr>
<tr>
   <td width="150">display</td>
   <td width="100"><i>i=block/fork</i></td>
   <td></td>
</tr>
</table>
<h3 class="subtitle">Gates:</h3>
<table class="paramtable">
   <tr>
      <th>Name</th>
      <th>Direction</th>
      <th>Size</th>
      <th>Description</th>
   </tr>
<tr class="inherited">
   <td width="150">upperGateIn</xsl:if></td>
   <td width="100"><i>input</i></td>
   <td width="50"></td>   <td>
<p>from upper layer</p>
</td>
</tr>
<tr class="inherited">
   <td width="150">upperGateOut</xsl:if></td>
   <td width="100"><i>output</i></td>
   <td width="50"></td>   <td>
<p>to uppe layer</p>
</td>
</tr>
<tr class="inherited">
   <td width="150">upperControlIn</xsl:if></td>
   <td width="100"><i>input</i></td>
   <td width="50"></td>   <td>
<p>control from upper layer</p>
</td>
</tr>
<tr class="inherited">
   <td width="150">upperControlOut</xsl:if></td>
   <td width="100"><i>output</i></td>
   <td width="50"></td>   <td>
<p>control to upper layer</p>
</td>
</tr>
<tr class="inherited">
   <td width="150">lowerGateIn</xsl:if></td>
   <td width="100"><i>input</i></td>
   <td width="50"></td>   <td>
<p>from lower layer</p>
</td>
</tr>
<tr class="inherited">
   <td width="150">lowerGateOut</xsl:if></td>
   <td width="100"><i>output</i></td>
   <td width="50"></td>   <td>
<p>to lower layer</p>
</td>
</tr>
<tr class="inherited">
   <td width="150">lowerControlIn</xsl:if></td>
   <td width="100"><i>input</i></td>
   <td width="50"></td>   <td>
<p>control from lower layer</p>
</td>
</tr>
<tr class="inherited">
   <td width="150">lowerControlOut</xsl:if></td>
   <td width="100"><i>output</i></td>
   <td width="50"></td>   <td>
<p>control to lower layer</p>
</td>
</tr>
</table>
<h3 class="subtitle">Source code:</h3>
<pre class="src"><span style="color: #808080; font-style: italic; ">// Wiseroute is a simple loop-free routing algorithm that
// builds a routing tree from a central network point, designed
// for sensor networks and convergecast traffic.
//
// The sink (the device at the center of the network) broadcasts
// a route building message. Each network node that receives it
// selects the sink as parent in the routing tree, and rebroadcasts
// the route building message. This procedure maximizes the probability
// that all network nodes can join the network, and avoids loops.
// Parameter sinkAddress gives the sink network address, 
// rssiThreshold is a threshold to avoid using bad links (with too low
// RSSI values) for routing, and routeFloodsInterval should be set to
// zero for all nodes except the sink. Each routeFloodsInterval, the
// sink restarts the tree building procedure. Set it to a large value
// if you do not want the tree to be rebuilt.
</span><span style="color: #800000; font-weight: bold; ">simple</span><span style="color: #000000; "> </span><span style="color: #000000; ">WiseRoute</span><span style="color: #000000; "> </span><span style="color: #800000; font-weight: bold; ">extends</span><span style="color: #000000; "> </span><span style="color: #000000; ">BaseNetwLayer</span><span style="color: #000000; ">
{
    </span><span style="color: #800000; font-weight: bold; ">parameters</span><span style="color: #000000; ">:
        </span><span style="color: #808080; font-style: italic; ">// debug switch
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">bool</span><span style="color: #000000; "> </span><span style="color: #000000; ">debug</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">false</span><span style="color: #000000; ">);
        </span><span style="color: #000080; font-weight: bold; ">bool</span><span style="color: #000000; "> </span><span style="color: #000000; ">trace</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">false</span><span style="color: #000000; ">);
        </span><span style="color: #000080; font-weight: bold; ">bool</span><span style="color: #000000; "> </span><span style="color: #000000; ">useSimTracer</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">false</span><span style="color: #000000; ">);

        </span><span style="color: #808080; font-style: italic; ">// sink node address (integer)
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">int</span><span style="color: #000000; "> </span><span style="color: #000000; ">sinkAddress</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">0</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// the sink directs the tree building procedure with periodic floods.
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// iterationDelay is the period between two floods.
</span><span style="color: #000000; ">

        </span><span style="color: #808080; font-style: italic; ">// RSSI threshold for route selection
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">rssiThreshold</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">dBm</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(-</span><span style="color: #008000; ">50</span><span style="color: #000000; "> </span><span style="color: #000000; ">dBm</span><span style="color: #000000; ">);

        </span><span style="color: #808080; font-style: italic; ">// If set to zero, this node does not initiates route tree building.
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// If set to a value larger than zero, this nodes periodically initiates route tree building.
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">routeFloodsInterval</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">s</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">0</span><span style="color: #000000; "> </span><span style="color: #000000; ">s</span><span style="color: #000000; ">);
        </span><span style="color: #000000; font-weight: bold; ">@display</span><span style="color: #000000; ">(</span><span style="color: #008000; ">&quot;i=block/fork&quot;</span><span style="color: #000000; ">);
        </span><span style="color: #000000; font-weight: bold; ">@class</span><span style="color: #000000; ">(</span><span style="color: #000000; ">WiseRoute</span><span style="color: #000000; ">);

}

</span></pre>
   <hr><p class="footer"><a href="http://creativecommons.org/licenses/by-sa/3.0" target="_top"><img src="by-sa.png"></a> This documentation is released under the <a href="http://creativecommons.org/licenses/by-sa/3.0" target="_top">Creative Commons license</a></p>
   </body>
</html>
